<?php
$sh_languages['python'] = array(
    // State #0
    array(
        array(
            '/\b(?:import|from)\b/i',
            'sh_preproc',
            -1
        ),
        array(
            '/#/i',
            'sh_comment',
            1
        ),
        array(
            '/\b[+-]?(?:(?:0x[a-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/i',
            'sh_number',
            -1
        ),
        array(
            '/\b(?:and|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|global|if|in|is|lambda|not|or|pass|print|raise|return|try|while)\b/i',
            'sh_keyword',
            -1
        ),
        array(
            '/^(?:[\s]*\'{3})/i',
            'sh_comment',
            2
        ),
        array(
            '/^(?:[\s]*\"{3})/i',
            'sh_comment',
            3
        ),
        array(
            '/^(?:[\s]*\'(?:[^\\\\\']|\\\\.)*\'[\s]*|[\s]*\"(?:[^\\\\\"]|\\\\.)*\"[\s]*)$/i',
            'sh_comment',
            -1
        ),
        array(
            '/(?:[\s]*\'{3})/i',
            'sh_string',
            4
        ),
        array(
            '/(?:[\s]*\"{3})/i',
            'sh_string',
            5
        ),
        array(
            '/"/i',
            'sh_string',
            6
        ),
        array(
            '/\'/i',
            'sh_string',
            7
        ),
        array(
            '/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\\\|:|;|,|\.|\/|\?|&|<|>|\||\{|\}/i',
            'sh_symbol',
            -1
        ),
        array(
            '/(?:[a-z]|_)[a-z0-9_]*(?=[ \t]*\()/i',
            'sh_function',
            -1
        )
    ),
    // State #1
    array(
        array(
            '/$/i',
            null,
            -2
        )
    ),
    // State #2
    array(
        array(
            '/(?:\'{3})/i',
            'sh_comment',
            -2
        )
    ),
    // State #3
    array(
        array(
            '/(?:\"{3})/i',
            'sh_comment',
            -2
        )
    ),
    // State #4
    array(
        array(
            '/(?:\'{3})/i',
            'sh_string',
            -2
        )
    ),
    // State #5
    array(
        array(
            '/(?:\"{3})/i',
            'sh_string',
            -2
        )
    ),
    // State #6
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/\\\\(?:\\\\|")/i',
            null,
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            -2
        )
    ),
    // State #7
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/\\\\(?:\\\\|\')/i',
            null,
            -1
        ),
        array(
            '/\'/i',
            'sh_string',
            -2
        )
    )
);
